package com.ckjava.service;

import com.ckjava.aop.annotation.MultiDataSource;
import com.ckjava.dao.TUserDao;
import com.ckjava.entity.DbEnum;
import com.ckjava.entity.TUserEntity;
import com.ckjava.entity.base.PageParamer;
import com.ckjava.service.base.BaseMybatisCrudService;
import com.ckjava.xutils.http.Page;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Optional;

@Service
public class TUserService extends BaseMybatisCrudService<TUserEntity, TUserDao> {
    @Override
    public Class<TUserEntity> getClassType() {
        return TUserEntity.class;
    }

    @Override
    @MultiDataSource(DbEnum.user)
    public Optional<TUserEntity> get(long id) {
        return super.get(id);
    }

    @Override
    @MultiDataSource(DbEnum.user)
    public Optional<List<TUserEntity>> getAll() {
        return super.getAll();
    }

    @Override
    @MultiDataSource(DbEnum.user)
    public Optional<List<TUserEntity>> getByParam(TUserEntity entity) {
        return super.getByParam(entity);
    }

    @Override
    @MultiDataSource(DbEnum.user)
    public Optional<Page<TUserEntity>> getPage(PageParamer pageParamer) {
        return super.getPage(pageParamer);
    }

    @Override
    @MultiDataSource(DbEnum.user)
    public Optional<Long> save(TUserEntity entity) {
        return super.save(entity);
    }

    @Override
    @MultiDataSource(DbEnum.user)
    public Optional<Long> update(TUserEntity entity) {
        return super.update(entity);
    }

    @Override
    @MultiDataSource(DbEnum.user)
    public Optional<Long> saveOrUpdate(TUserEntity entity) {
        return super.saveOrUpdate(entity);
    }

    @Override
    @MultiDataSource(DbEnum.user)
    public Optional<Integer> delete(Long id) {
        return super.delete(id);
    }

    @Override
    @MultiDataSource(DbEnum.user)
    public Optional<Integer> deletePhysical(Long id) {
        return super.deletePhysical(id);
    }
}

